<%-- 
    Document   : View
    Created on : Jul 3, 2014, 10:57:28 AM
    Author     : Van Hung
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>View Page</title>
    </head>
    <body>
        <form action="Controller?task=search" method="post">
            Username: <input name="user">
            <input type="submit" value="Search">
        </form>
        <h1>View!</h1>
        <table border="1" width="50%">
            <tr>
                <th>UserName</th>
                <th>Password</th>
                <th>Role</th>
                <th>Action</th>
            </tr>
            <c:forEach var="row" items="${ACC}">
                <tr>
                    <td>${row.username}</td>
                    <td>${row.password}</td>
                    <td>${row.role}</td>
                    <td>
                        <a href="Controller?task=delete&user=${row.username}">Delete</a> |
                        <c:url var="update" value="Update.jsp">
                            <c:param name="user" value="${row.username}"/>
                            <c:param name="pass" value="${row.password}"/>
                            <c:param name="role" value="${row.role}"/>
                        </c:url>
                        <a href="${update}">Update</a>
                    </td>
                </tr>
            </c:forEach>

        </table>
        <a href="Insert.jsp">New Account</a>
    </body>
</html>
